<template>
  <div>
    <div class="butt">
      <el-button @click="Switch" type="text">	&lt;&lt;点击返回</el-button>
    </div>
    <div class="box">
      <h3>{{ data.title }}</h3>
      <div class="Author">
        <p>作者：{{ data.author }}</p>
        <p>|</p>
        <p>发表时间：{{ data.createTime | formatTimer }}</p>
      </div>
      <div v-html="data.content"></div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      data:''
    };
  },
  methods: {
    
    getdata() {
      // 公告详情
      this.$http
        .get("/paper/detail", {
            id:localStorage.getItem("paper")
        })
        .then((res) => {
          console.log(res);
          this.data=res.data[0];
          console.log(this.data);
        });
    },
    Switch() {
      this.$router.push({
        name: "tables"
      });
    },
  },

  mounted() {
    this.getdata();
  },
};
</script>

<style scoped>
.butt {
  position: fixed;
  top: 20px;
  left: 120px;
}
.box {
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  width: 800px;
  margin: 0 auto;
  padding: 20px;
  margin-top: 20px;
  margin-bottom: 20px;
}
h3 {
  text-align: center;
  margin-bottom: 15px;
}
.Author {
  overflow: hidden;
  width: 280px;
  margin: 0 auto;
  padding-bottom: 15px;
}
.Author p {
  float: left;
  color: #666a6d;
  margin-left: 5px;
  font-size: 13px;
}
</style>